<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

{% load i18n satchmo_category satchmo_google satchmo_util satchmo_currency satchmo_discounts app_plugins normalize_decimal %}
<head>
    {% block extra-head %}{% endblock %}
    <link rel="stylesheet" href="{{ media_url }}css/style.css" />
    <title>{% block title %}{{ shop_name }}{% if pagetitle %}: {{ pagetitle }}{% endif %}{% endblock %}</title>
</head>
{% block body %}
<body{% if bodyid %} id="{{ bodyid }}"{% endif %}{% if bodyclass %} class="{{ bodyclass }}"{% endif %}>
    <div id="container">
	    <div id="top">
	        <h1>{{ shop_name }}</h1>
	    </div>

	    <div id="navbar">
	    <ul>
	    	{% block navbar %}Breadcrumbs here{% endblock %}
	   	</ul>
    </div>

    <div id="sidebar-secondary">
		{% block sidebar-secondary %}
		<div>
			{% satchmo_search_form %}
		</div>
		<div>
			{% block sidebar %}
			<h3>{% trans "Shop Categories" %}</h3>
			{% block sidebar-categories %}
			<div id="menu_container">
				{% category_tree %}
			</div>
			{% endblock sidebar-categories %}
			
			{% block sidebar-secondary-bottom %}
			{% plugin_point "sidebar_secondary_bottom" %}
			{% endblock %}
			{% endblock sidebar %}
		</div>
		{% endblock sidebar-secondary %}
	</div>

	<div id="sidebar-primary">{# rightnav #}
		{% block sidebar-primary %}
		<h3>{% trans "Quick Links" %}</h3>
		{% url satchmo_product_recently_added as recenturl %}
		{% if recenturl %}<a href="{{ recenturl }}">{% trans "Recently Added" %}</a>{% endif %}
		{% url satchmo_product_best_selling as popularurl %}
		{% if popularurl %}<br/><a href="{{ popularurl }}">{% trans "Best Sellers" %}</a>{% endif %}
		{% plugin_point "sidebar_links" %}

	    <h3>{% trans "Account Information" %}</h3>
	    {% if user.is_staff %}
		<a href="/admin" target="blank">{% trans "Admin" %}</a><br/>
		{% endif %}
	    {% if user.is_authenticated %}
		{% url satchmo_account_info as accounturl %}
        {% if accounturl %}<a href="{{ accounturl }}" target="blank">{% trans "Account Details" %}</a><br/>{% endif %}
        <a href="{{ logout_url }}">{% trans "Log out" %}</a><br/>
	    {% else %}
        <a href="{{ login_url }}?next={{request.path}}">{% trans "Log in" %}</a><br/>
	    {% endif %}

		{% url satchmo_cart as carturl %}
	    {% if carturl %}<a href="{{ carturl }}">{% trans "Cart" %}</a>{% endif %}

	    {% if cart_count %}
        ({{ cart_count|normalize_decimal }}{% if cart.total %} - {{ cart|discount_cart_total:sale|currency }}{% endif %})<br/>
		{% url satchmo_checkout-step1 as checkouturl %}
        {% if checkouturl %}<a href="{{ checkouturl }}">{% trans "Check out" %}</a>{% endif %}
	    {% endif %}
	
		{% plugin_point "shop_sidebar_actions" %}
    
		{% url satchmo_contact as contact_url %}
	    {% if contact_url %}<p><a href="{{ contact_url }}">{% trans "Contact Us" %}</a></p>{% endif %}

		{% satchmo_language_selection_form %}

		{% block sidebar-primary-bottom %}
		{% plugin_point "shop_sidebar_primary" %}
		{% endblock %}
		{% endblock sidebar-primary %}
	</div>

	<div id="content">
	    {% block content %}{% endblock %}
	</div>

	<div id="footer">
		{% block footer %}
		{% blocktrans %}Powered by <a href="http://www.satchmoproject.com">Satchmo</a>.{% endblocktrans %}
		{% endblock %}
	</div>

    </div>
	{% block page-close %}
    {% block google-tracker %}
    {% if shop.options.GOOGLE.ANALYTICS.value %}
        {% show_tracker is_secure %}
    {% endif %}
    {% endblock %}
	{% endblock %}
</body>
{% endblock %}
</html>
